package br.com.upis.sispat.enums;

import java.util.ArrayList;
import java.util.List;
public enum UF {

	AC("AC", "Acre"),
	AL("AL", "Alagoas"),
	AP("AP", "Amap\u00E1"),
	AM("AM", "Amazonas"),
	BA("BA", "Bahia"),
	CE("CE", "Cear\u00E1"),
	DF("DF", "Distrito Federal"),
	ES("ES", "Esp\u00EDrito Santo"),
	GO("GO", "Goi\u00E1s"),
	MA("MA", "Maranh\u00E3o"),
	MT("MT", "Mato Grosso"),
	MS("MS", "Mato Grosso do Sul"),
	MG("MG", "Minas Gerais"),
	PA("PA", "Par\u00E1"),
	PB("PB", "Para\u00EDba"),
	PR("PR", "Paran\u00E1"),
	PE("PE", "Pernambuco"),
	PI("PI", "Piau\u00ED"),
	RR("RR", "Roraima"),
	RO("RO", "Rond\u00F4nia"),
	RJ("RJ", "Rio de Janeiro"),
	RN("RN", "Rio Grande do Norte"),
	RS("RS", "Rio Grande do Sul"),
	SC("SC", "Santa Catarina"),
	SP("SP", "S\u00E3o Paulo"),
	SE("SE", "Sergipe"),
	TO("TO", "Tocantins");
	
	private String sigla;
	private String descricao;
	private UF(String sigla, String descricao) {
		this.setSigla(sigla);
		this.setDescricao(descricao);
	}

	public static List<UF> getListUF() {
		List<UF> lista = new ArrayList<UF>();
		for (UF uf : UF.values())
			lista.add(uf);

		return lista;
	}

	public static UF getUfBySigla(String sigla) {

		for (UF uf : UF.values()) {
			if (uf.getSigla().equalsIgnoreCase(sigla)) {
				return uf;
			}
		}
		return null;
	}

	public String getSigla() {
		return sigla;
	}

	public void setSigla(String sigla) {
		this.sigla = sigla;
	}

	public String getDescricao() {
		return descricao;
	}

	public void setDescricao(String descricao) {
		this.descricao = descricao;
	}

	public static UF getUFBySigla(String dsUF) {

		for (UF u : UF.values()) {
			if (u.getSigla().equalsIgnoreCase(dsUF)) {
				return u;
			}
		}

		return UF.DF;
	}
}
